home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
wb
/
czesc_4
/
viruscheck
/
checkfile210.lha
/
CheckFile2
/
CheckFile2.vzrx
< prev
next >
Wrap
Text File
|
1996-10-15
|
6KB
|
214 lines
/*
$VER: CheckFile2 v2.09 (1312/10/1996)
Template: CheckFile2.vzrx FILE/A, QUIT/S
*/
VirusZ_prg = "DH0:Productivity/VirusUtils/VirusZ" /* Path&Filename of VirusZ Executeable */
LHA_prg = "LHA" /* Settings for Path where LHA DeArchiver program is */
LZX_prg = "LZX" /* Settings for Path where LZX DeArchiver program is */
ZIP_prg = "UnZip" /* Settings for Path where ZIP DeArchiver program is */
RAR_prg = "UnRar" /* Settings for Path where Rar DeArchiver program is */
DMS_prg = "DMS" /* Settings for Path where DMS DeArchiver program is */
DirTemp = "DH1:T/Temp/TempArcDir" /* Directory to check file based archives */
/* Settings for Disk Checking */
DiskTemp = "FF0:" /* Path To check DMS archives (Virtual or Real can be used) */
DiskBlnk = "Yes" /* Either 'Yes' or anything else for 'No' to Format */
FormatName = "Tested" /* Name of disk after it is formatted */
DiskRmve = "No" /* Either 'Yes' or anything else for 'No' to remove(UnMount) */
Remove_prg = "Assign Dismount" /* Program used to remove(UnMount) Virtual Disk (RemSD0, RemRAD or Assign DisMount)*/
Delete_prg = "C:Delete" /* Where the Delete command is and what it is called */
Mount_prg = "C:Mount" /* Where the Mount command is and what it is called */
Protect_prg = "C:Protect" /* Where the Protect command is and what it is called */
Format_prg = "SYS:System/Format" /* Where the Format command is and what it is called */
/* Start of the program, Do NOT alter past this line! */
Quit_Check = "UnSet" /* Check variable for VirusZ running */
Options Results
Options FailAt 60
Parse Upper Arg File2Check Quit_Opt
IF File2Check = "" Then Do /* Checks if a filename was given */
Say "
No filename given to check!
"
Exit
End
ArcType = Index(File2Check,.LHA) + Index(File2Check,.LZH) + Index(File2Check,.LZX) + Index(File2Check,.ZIP) + Index(File2Check,.RAR) + Index(File2Check,.DMS)
IF ArcType = 0 Then Do
FileX = "NotArc"
Signal VirusZFileCheck
End
IF ~Show(Ports,VIRUSZ_II.REXX) Then Do
Address Command VirusZ_prg
Quit_Check = "Set"
StartTime = Time(Seconds)
Do While ~Show(Ports,VIRUSZ_II.REXX)
IF Time(Seconds) - StartTime > 25 Then Do
Say "
Error loading VirusZ! (Review CheckFile2 Prefs)
"
Exit
End
End
End
IF Exists(DirTemp) Then Do
Address Command Protect_prg ">NIL: <NIL: "DirTemp" +RWED ALL"
Address Command Delete_prg ">NIL: <NIL: "DirTemp" ALL FORCE"
IF RC ~= 0 Then Do
Say "
Error trying to empty temporary directory!
"
Signal VirusZShutDown
End
End
/* DeArchiving Section */
ArcType = Index(File2Check,.LHA) + Index(File2Check,.LZH)
IF ArcType ~= 0 Then Do
Address Command LHA_prg ">NIL: <NIL: x "File2Check DirTemp"/"
IF RC ~= 0 Then Do
Say "
Error extracting "File2Check" archive!
"
Signal DeleteDirTemp
End
Signal VirusZArcCheck
End
ArcType = Index(File2Check,.LZX)
IF ArcType ~= 0 Then Do
Address Command LZX_prg ">NIL: <NIL: x "File2Check DirTemp"/"
IF RC ~= 0 Then Do
Say "
Error extracting "File2Check" archive!
"
Signal DeleteDirTemp
End
Signal VirusZArcCheck
End
ArcType = Index(File2Check,.ZIP)
IF ArcType ~= 0 Then Do
Address Command "MakeDir "DirTemp
IF RC ~= 0 Then Do
Say "
Error making temporary directory!
"
Signal VirusZShutDown
End
Address Command ZIP_prg ">NIL: "File2Check "-d "DirTemp"/"
IF RC ~= 0 Then Do
Say "
Error extracting "File2Check" archive!
"
Signal DeleteDirTemp
End
Signal VirusZArcCheck
End
ArcType = Index(File2Check,.RAR)
IF ArcType ~= 0 Then Do
Address Command "MakeDir "DirTemp
IF RC ~= 0 Then Do
Say "
Error making temporary directory!
"
Signal VirusZShutDown
End
Address Command RAR_prg ">NIL: x "File2Check DirTemp"/"
IF RC ~= 0 Then Do
Say "
Error extracting "File2Check" archive!
"
Signal DeleteDirTemp
End
Signal VirusZArcCheck
End
ArcType = Index(File2Check,.DMS)
IF ArcType ~= 0 Then Do
FileX = "DMS"
Address Command "Assign >NIL: "DiskTemp" exists"
IF RC = 5 Then Address Command "Mount >NIL: "DiskTemp
Address Command DMS_prg " >NIL: <NIL: Write "File2Check " To "DiskTemp" NOVERIFY"
IF RC ~= 0 Then Do
Say "
Error extracting "File2Check" archive!
"
Signal DeleteDisk
End
Signal VirusZDMSCheck
End
/* Virus Checking Section */
VirusZArcCheck:
IF Exists(DirTemp) Then Do
Address VIRUSZ_II.REXX CHECKDIR DirTemp DECREXEC DECRDATA
IF RC = 0 Then Say "
Archive "File2Check" is clean.
"
IF RC = 5 Then Say "
Archive "File2Check" contains virus(es)!
"
IF RC = 10 Then Say "
Error checking "File2Check" archive!
"
Signal DeleteDirTemp
End
VirusZFileCheck:
IF FileX = "NotArc" Then Do
Address Command "MakeDir "DirTemp
Address Command "Copy "File2Check" to "DirTemp"/ QUIET NOPRO NOREQ"
Address VIRUSZ_II.REXX CHECKDIR DirTemp DECREXEC DECRDATA
IF RC = 0 Then Say "
File "File2Check" is clean.
"
IF RC = 5 Then Say "
File"File2Check" contains virus(es)!
"
IF RC = 10 Then Say "
Error checking "File2Check" File!
"
Signal DeleteDirTemp
End
VirusZDMSCheck:
IF FileX = "DMS" Then Do
Address VIRUSZ_II.REXX CHECKDIR DiskTemp DECREXEC DECRDATA
IF RC = 0 Then Say "
Archive "File2Check" is clean.
"
IF RC = 5 Then Say "
Archive "File2Check" contains virus(es)!
"
IF RC = 10 Then Say "
Error checking "File2Check" archive!
"
Signal DeleteDisk
End
DeleteDisk:
IF FileX = "DMS" Then Do
Upper DiskBlnk
Upper DiskRmve
IF DiskBlnk = "YES" Then Do
Address Command Format_prg " >NIL: <NIL: DEVICE="DiskTemp" NAME="FormatName" FFS INTL NOICONS QUICK"
IF RC ~= 0 Then Do
Say "
Error blanking checked disk!
"
Signal VirusZShutDown
End
End
IF DiskRmve = "YES" Then Do
Address Command Prog_Rmv DiskPath
IF RC ~= 0 Then Do
Say "
Error Dismounting checked disk!
"
Signal VirusZShutDown
End
End
Signal VirusZShutDown
End
DeleteDirTemp:
IF Exists(DirTemp) Then Do
Address Command Protect_prg DirTemp"/#? RWED ADD ALL QUIET"
Address Command Delete_prg ">NIL: <NIL:" DirTemp ALL
IF RC ~= 0 Then Do
Say "
Error deleting temporary directory!
"
Signal VirusZShutDown
End
Signal VirusZShutDown
End
VirusZShutDown:
IF Quit_Check = "Set" Then Do
IF Quit_Opt = "QUIT" Then Do
Address VIRUSZ_II.REXX QUIT
End
Say " "
End